package com.njupt.simulation.utils;

import cn.hutool.core.util.NumberUtil;

public class freeSpaceLoss_Lbfs {
    /**
     * 自由空间基本传播损耗
     * @param PathLength_d 路径长度d  km
     * @param Frequence_f 工作频点f  GHZ
     * @return
     */
    public static Double freeSpaceLoss_Lbfs(Double PathLength_d, Double Frequence_f){

        Double a0 = NumberUtil.mul(Frequence_f,PathLength_d);
        Double a1 = Math.log10(a0);
        Double a2 = 20.0;
        Double a3 = NumberUtil.mul(a2,a1);
        Double a5 = 32.45;
        Double Lbfs = NumberUtil.add(a5,a3);
        return Lbfs;
    }
    public static void main(String[] args) {

        double lf1= freeSpaceLoss_Lbfs(550.0,2160.0);
        double lf2= freeSpaceLoss_Lbfs(807.5,10.9);
        double lf3= freeSpaceLoss_Lbfs(780.0,2.0);
        // 打印结果
        System.out.println("受扰链路自由空间传播损耗" +lf1);
        System.out.println("干扰链路1自由空间传播损耗" +lf2);
        System.out.println("干扰链路2自由空间传播损耗" +lf3);
    }

}
